/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.dao.impl;

import cc.altius.dao.AmbulanceSerDao;
import cc.altius.model.AmbulanceSer;
import java.util.List;
import javax.sql.DataSource;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

/**
 *
 * @author sagar
 */
@Repository("AmbulanceSerDao")
public class AmbulanceSerDaoImpl implements AmbulanceSerDao {
    
    private SessionFactory sessionFactory;
    private HibernateTemplate hibernateTemplate;
    @Autowired
    private DataSource dataSource;
    private JdbcTemplate jdbcTemplate;
    
    @Autowired
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
        this.jdbcTemplate = new JdbcTemplate(dataSource);
    }

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    @Override
    public List<AmbulanceSer> getAmbulanceServiceList() {
        List<AmbulanceSer> ambulanceService = this.hibernateTemplate.find("from AmbulanceSer");
        return ambulanceService;
    }

    @Override
    public AmbulanceSer getAmbulanceServiceById(int ambulanceServiceId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    
    
}
